<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const p1 =() =>{
            return new Promise((resvole,reject)=>{
                setTimeout(()=>{
                    console.log('1');
                    resvole('1')
                    // reject('a')
                },1000)
            })
        }
        const p2 =() =>{
            return new Promise((resvole,reject)=>{
                setTimeout(()=>{
                    console.log('2');
                    resvole('2')
                },500)
            })
        }
        const p3 =() =>{
            return new Promise((resvole,reject)=>{
                setTimeout(()=>{
                    console.log('3');
                    resvole('3')
                },1200)
            })
        }

        const test =async ()=>{
            const res1=await p1()
            console.log('res1',res1);
            const res2=await p2()
            console.log('res2',res2);
            const res3=await p3()
            console.log('res3',res3);
            

        }
        test().catch((err)=>{
            console.log(err);
        })
    </script>
</body>
</html>